Prevent criticals when initializing a Wayland display
authorMatthias Clasen <mclasen@redhat.com>
Sat, 4 May 2013 20:11:00 +0000 (16:11 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 4 May 2013 20:13:09 +0000 (16:13 -0400)
When we call _gdk_wayland_display_load_cursor_theme during
the initial opening of the first display, gdk_setting_get does
not work yet, since it relies on the default display/screen
being set, which only happens after open returns.
Instead, just use the screen of this display.

gdk/wayland/gdkdisplay-wayland.c

index 3a80d0a9a154d511b61a93b8051600194ceaaf94..ee51ab57cae352a98eab6f6f16f37070de4127fe 100644 (file)
@@ -650,14 +650,14 @@ _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *wayland_display)
   g_assert (wayland_display->shm);
 
   g_value_init (&v, G_TYPE_INT);
-  if (gdk_setting_get ("gtk-cursor-theme-size", &v))
+  if (gdk_screen_get_setting (wayland_display->screen, "gtk-cursor-theme-size", &v))
     size = g_value_get_int (&v);
   else
     size = 32;
   g_value_unset (&v);
 
   g_value_init (&v, G_TYPE_STRING);
-  if (gdk_setting_get ("gtk-cursor-theme-name", &v))
+  if (gdk_screen_get_setting (wayland_display->screen, "gtk-cursor-theme-name", &v))
     name = g_value_get_string (&v);
   else
     name = "default";